<template>
  <div>
    <pdf ref="myPdf"></pdf>
  </div>
</template>

<script>
import { 
  ref
} from 'vue'
import FileModel from '@/api/file.js';
import pdf from '@/components/pdfPreview.vue'

export default {
  name: 'pdfPreview',
  components: {
    pdf
  },
  setup() {
    const myPdf = ref();

    const getPdf = () => {
      FileModel.getPdfFlow().then(res => {
        myPdf.value.previewPDF(res); 
      }).catch(err => {
        console.log(err);
      })
    }

    getPdf();

    return {
      myPdf
    }
  }
}
</script>